import java.util.Date;

public abstract class User {
    protected String id;
    protected String username;
    protected String password;
    protected String phone;
    protected String userType;
    protected Date registerTime;
    protected int loginAttempts;
    protected boolean locked;

    public User(String id, String username, String password, String phone, String userType) {
        this.id = id;
        this.username = username;
        this.password = password;
        this.phone = phone;
        this.userType = userType;
        this.registerTime = new Date();
        this.loginAttempts = 0;
        this.locked = false;
    }

    public abstract boolean login(String password);

    // Getters and Setters
    public String getId() {
        return id;
    }

    public String getUsername() {
        return username;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getUserType() {
        return userType;
    }

    public Date getRegisterTime() {
        return registerTime;
    }

    public void setRegisterTime(Date registerTime) {
        this.registerTime = registerTime;
    }
}
